//
//  FactoryClass.h
//  ECTECTIphone
//
//  Created by mac on 15/5/21.
//
//

#import <Foundation/Foundation.h>
//#import "MBProgressHUD.h"

typedef enum {
    
    ReplaceType_telephone,//手机
    ReplaceType_mail,//邮箱
    ReplaceType_name,//姓名
    ReplaceType_ID,//身份证
    ReplaceType_ectCode//证通卡号
}ReplaceType;

@interface FactoryClass : NSObject
//+(BOOL)validateMobile:(NSString *)mobileNum;
//+ (BOOL) validateEmail:(NSString *)email;
//+ (BOOL)isValidateIdentityCard:(NSString *)identityCard;
//+ (BOOL)containNumberCharactorChinese:(NSString *)inputstr;
//+(BOOL)validateNumber:(NSString *)textString;
//+(MBProgressHUD*)HUDShowMessage:(NSString*)msg addedToView:(UIView*)view;

//+ (BOOL)containNumberChineseEnglishUnderlineAndMinus:(NSString *)inputstr;
//+ (BOOL)containAtLeastOneNumberAndOneCharactor:(NSString*)inputstr;

//只包含中文
//+ (BOOL)containChineseOnly:(NSString *)inputstr;

//获取设备型号
+(NSString *)getDeviceType;

//获取osname
+(NSString *)getOSName;
////获取系统版本

+(NSString *)getphoneVersion;
//获取手机 IP
+(NSString *)getIPAddress;

//获取证通APP版本号
+(NSString *)getBbVersion;

#pragma mark - 输入金额，只能是数字或小数点
+ (BOOL)isValidateAmount:(NSString *)string;

/**
 *  脱敏处理
 *  @param str  处理内容
 *  @param type 处理类型
 *  @return 处理结果
 */
+ (NSString* )ShowContentByStr:(NSString*)str Type:(ReplaceType)type;

/**
 *  仅支持汉字、字母、数字、常规标点符号，20个字节
 *
 *  @param inputstr
 *
 *  @return YES 验证通过  NO  验证不通过
 */
+ (BOOL)containOnlyChineseEnNumber:(NSString *)inputstr;

+ (NSString *)bankCardFormat:(NSString *)string;//输入时分段显示 在输入时才会变化

+ (NSString *)bankCradShow:(NSString*)string;//银行卡分段显示 输入完成变化

+ (BOOL)stringContainsEmoji:(NSString *)string;

//+ (CGFloat)getTextWidth:(UIFont *)font string:(NSString *)string;
+ (NSString*)getAesEncrypt:(NSString *)encrypt;

+ (NSString*)getDecCode:(NSString *)dec;

+(NSString *)URLDecodedString:(NSString *)str;

+ (NSString *)md5Hash:(NSString *)str;

+ (NSString *)randomIdentify;   //生成32位随机值

+ (void)deleteHeaderImage;


//搜索结果显示高亮
+ (NSAttributedString *)attributeNewMessage:(NSString *)text andKeyWord:(NSString *)keyWord;
//获取汉字的拼
+ (NSString *)pinyinstring:(NSString *)string;
//字符长度
+ (NSUInteger) lenghtWithString:(NSString *)string;

+ (id )myJSONVlue:(NSString *)jsonStr;

+ (NSString *)myJSONString:(id)dic;

//获得尾号四位
+ (NSString *)getLastFour:(NSString *)num;

/**
 ** lineView:	   需要绘制成虚线的view
 ** lineLength:	 虚线的宽度
 ** lineSpacing:	虚线的间距
 ** lineColor:	  虚线的颜色
 **/
//+ (void)drawDashLine:(UIView *)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UIColor *)lineColor;//画一条虚线

+ (NSString *)getAAImagePath;//得到通讯录图片缓存路径

+ (NSString *)getFirstLetter:(NSString *)pinyin;

+ (BOOL)isChineseAndLetter:(NSString *)text;//判断数字和字母


/**
 将数字以小数点后几位的形式转换(解决NSString转float/double型时精度不对)

 @param moneyString 字符串型的钱数
 @param position 保留到小数点后几位
 @return 返回你想要的结果
 */
+(NSString *)moneyString:(NSString *)moneyString accurateToPosition:(NSInteger)position;
@end
